////def projectDir = new File('..')
////String projectDirPath = projectDir.absolutePath
////
////projectDir.eachFileRecurse{
////	if(!it.isFile())
////		return 
////
////	String pathRelative = it.absolutePath.substring(projectDirPath.size()).replaceAll("\\\\", '/')
////
////	println pathRelative
////}
//
////import com.github.kevinsawicki.http.HttpRequest
////
////String url = 'http://localhost:8888/store/plugin/download?code=wx-messager&version=1.0'
////
////def bytes = HttpRequest.get(url).bytes()
////
////new File('xx.zip').setBytes(bytes)
//
////import org.apache.commons.codec.digest.DigestUtils
////println DigestUtils.shaHex('aaa')
////println DigestUtils.md5Hex('aaa')
//
//
////TreeMap params = [x: 1, b: 2]
////
////println params
//
//String str = '''
//<xml><return_code><![CDATA[SUCCESS]]></return_code>
//<return_msg><![CDATA[OK]]></return_msg>
//<appid><![CDATA[wx9f7507a78aa0c8f0]]></appid>
//<mch_id><![CDATA[1233859202]]></mch_id>
//<nonce_str><![CDATA[RUNnVfOuOiJ6nEZy]]></nonce_str>
//<sign><![CDATA[65DF6B47D23B9C8C8B9D2B888AD7E4BF]]></sign>
//<result_code><![CDATA[SUCCESS]]></result_code>
//<prepay_id><![CDATA[wx20150603133428021367c84f0517318194]]></prepay_id>
//<trade_type><![CDATA[JSAPI]]></trade_type>
//</xml>
//'''
//
//		String tmp = str.replace('<xml>', '').replace('</xml>', '')
//		Map r = [:]
//
//		def pat = ~/<([^>]+)>(.+)<\/[^>]+>/
//		def mat = tmp =~ pat
//
//		if(mat){
//			mat.each{it ->
//				r[it[1]] = it[2].replace('<![CDATA[', '').replace(']]>', '')
//			}
//		}
//		
//		println r

String appid = 'wx9f7507a78aa0c8f0'
String redirectUri = 'http://tech11.cn/wx/pay/bige'
redirectUri = URLEncoder.encode(redirectUri)
println "https://open.weixin.qq.com/connect/oauth2/authorize?appid=${appid}&redirect_uri=${redirectUri}&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect"